using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_Core_UIData_HImageData_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.Core.UIData.HImageData);

            field = type.GetField("graphicsData", flag);
            app.RegisterCLRFieldGetter(field, get_graphicsData_0);
            app.RegisterCLRFieldSetter(field, set_graphicsData_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_graphicsData_0, AssignFromStack_graphicsData_0);
            field = type.GetField("Sprite", flag);
            app.RegisterCLRFieldGetter(field, get_Sprite_1);
            app.RegisterCLRFieldSetter(field, set_Sprite_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_Sprite_1, AssignFromStack_Sprite_1);
            field = type.GetField("spriteType", flag);
            app.RegisterCLRFieldGetter(field, get_spriteType_2);
            app.RegisterCLRFieldSetter(field, set_spriteType_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_spriteType_2, AssignFromStack_spriteType_2);
            field = type.GetField("fillAmount", flag);
            app.RegisterCLRFieldGetter(field, get_fillAmount_3);
            app.RegisterCLRFieldSetter(field, set_fillAmount_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_fillAmount_3, AssignFromStack_fillAmount_3);
            field = type.GetField("fillCenter", flag);
            app.RegisterCLRFieldGetter(field, get_fillCenter_4);
            app.RegisterCLRFieldSetter(field, set_fillCenter_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_fillCenter_4, AssignFromStack_fillCenter_4);
            field = type.GetField("fillClockwise", flag);
            app.RegisterCLRFieldGetter(field, get_fillClockwise_5);
            app.RegisterCLRFieldSetter(field, set_fillClockwise_5);
            app.RegisterCLRFieldBinding(field, CopyToStack_fillClockwise_5, AssignFromStack_fillClockwise_5);
            field = type.GetField("fillMethod", flag);
            app.RegisterCLRFieldGetter(field, get_fillMethod_6);
            app.RegisterCLRFieldSetter(field, set_fillMethod_6);
            app.RegisterCLRFieldBinding(field, CopyToStack_fillMethod_6, AssignFromStack_fillMethod_6);
            field = type.GetField("fillOrigin", flag);
            app.RegisterCLRFieldGetter(field, get_fillOrigin_7);
            app.RegisterCLRFieldSetter(field, set_fillOrigin_7);
            app.RegisterCLRFieldBinding(field, CopyToStack_fillOrigin_7, AssignFromStack_fillOrigin_7);
            field = type.GetField("pixelsPerUnit", flag);
            app.RegisterCLRFieldGetter(field, get_pixelsPerUnit_8);
            app.RegisterCLRFieldSetter(field, set_pixelsPerUnit_8);
            app.RegisterCLRFieldBinding(field, CopyToStack_pixelsPerUnit_8, AssignFromStack_pixelsPerUnit_8);
            field = type.GetField("preserveAspect", flag);
            app.RegisterCLRFieldGetter(field, get_preserveAspect_9);
            app.RegisterCLRFieldSetter(field, set_preserveAspect_9);
            app.RegisterCLRFieldBinding(field, CopyToStack_preserveAspect_9, AssignFromStack_preserveAspect_9);
            field = type.GetField("Size", flag);
            app.RegisterCLRFieldGetter(field, get_Size_10);
            app.RegisterCLRFieldSetter(field, set_Size_10);
            app.RegisterCLRFieldBinding(field, CopyToStack_Size_10, AssignFromStack_Size_10);
            field = type.GetField("ElementSize", flag);
            app.RegisterCLRFieldGetter(field, get_ElementSize_11);
            app.RegisterCLRFieldSetter(field, set_ElementSize_11);
            app.RegisterCLRFieldBinding(field, CopyToStack_ElementSize_11, AssignFromStack_ElementSize_11);

            app.RegisterCLRMemberwiseClone(type, PerformMemberwiseClone);

            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.Core.UIData.HImageData());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.Core.UIData.HImageData[s]);


        }

        static void WriteBackInstance(ILRuntime.Runtime.Enviorment.AppDomain __domain, StackObject* ptr_of_this_method, IList<object> __mStack, ref huqiang.Core.UIData.HImageData instance_of_this_method)
        {
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            switch(ptr_of_this_method->ObjectType)
            {
                case ObjectTypes.Object:
                    {
                        __mStack[ptr_of_this_method->Value] = instance_of_this_method;
                    }
                    break;
                case ObjectTypes.FieldReference:
                    {
                        var ___obj = __mStack[ptr_of_this_method->Value];
                        if(___obj is ILTypeInstance)
                        {
                            ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method;
                        }
                        else
                        {
                            var t = __domain.GetType(___obj.GetType()) as CLRType;
                            t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method);
                        }
                    }
                    break;
                case ObjectTypes.StaticFieldReference:
                    {
                        var t = __domain.GetType(ptr_of_this_method->Value);
                        if(t is ILType)
                        {
                            ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method;
                        }
                        else
                        {
                            ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method);
                        }
                    }
                    break;
                 case ObjectTypes.ArrayReference:
                    {
                        var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as huqiang.Core.UIData.HImageData[];
                        instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method;
                    }
                    break;
            }
        }


        static object get_graphicsData_0(ref object o)
        {
            return ((huqiang.Core.UIData.HImageData)o).graphicsData;
        }

        static StackObject* CopyToStack_graphicsData_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.UIData.HImageData)o).graphicsData;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_graphicsData_0(ref object o, object v)
        {
            huqiang.Core.UIData.HImageData ins =(huqiang.Core.UIData.HImageData)o;
            ins.graphicsData = (huqiang.Core.UIData.HGraphicsData)v;
            o = ins;
        }

        static StackObject* AssignFromStack_graphicsData_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.Core.UIData.HGraphicsData @graphicsData = (huqiang.Core.UIData.HGraphicsData)typeof(huqiang.Core.UIData.HGraphicsData).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            huqiang.Core.UIData.HImageData ins =(huqiang.Core.UIData.HImageData)o;
            ins.graphicsData = @graphicsData;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_Sprite_1(ref object o)
        {
            return ((huqiang.Core.UIData.HImageData)o).Sprite;
        }

        static StackObject* CopyToStack_Sprite_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.UIData.HImageData)o).Sprite;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_Sprite_1(ref object o, object v)
        {
            huqiang.Core.UIData.HImageData ins =(huqiang.Core.UIData.HImageData)o;
            ins.Sprite = (System.Int32)v;
            o = ins;
        }

        static StackObject* AssignFromStack_Sprite_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @Sprite = ptr_of_this_method->Value;
            huqiang.Core.UIData.HImageData ins =(huqiang.Core.UIData.HImageData)o;
            ins.Sprite = @Sprite;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_spriteType_2(ref object o)
        {
            return ((huqiang.Core.UIData.HImageData)o).spriteType;
        }

        static StackObject* CopyToStack_spriteType_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.UIData.HImageData)o).spriteType;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_spriteType_2(ref object o, object v)
        {
            huqiang.Core.UIData.HImageData ins =(huqiang.Core.UIData.HImageData)o;
            ins.spriteType = (huqiang.Core.UIData.SpriteType)v;
            o = ins;
        }

        static StackObject* AssignFromStack_spriteType_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.Core.UIData.SpriteType @spriteType = (huqiang.Core.UIData.SpriteType)typeof(huqiang.Core.UIData.SpriteType).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)20);
            huqiang.Core.UIData.HImageData ins =(huqiang.Core.UIData.HImageData)o;
            ins.spriteType = @spriteType;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_fillAmount_3(ref object o)
        {
            return ((huqiang.Core.UIData.HImageData)o).fillAmount;
        }

        static StackObject* CopyToStack_fillAmount_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.UIData.HImageData)o).fillAmount;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_fillAmount_3(ref object o, object v)
        {
            huqiang.Core.UIData.HImageData ins =(huqiang.Core.UIData.HImageData)o;
            ins.fillAmount = (System.Single)v;
            o = ins;
        }

        static StackObject* AssignFromStack_fillAmount_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @fillAmount = *(float*)&ptr_of_this_method->Value;
            huqiang.Core.UIData.HImageData ins =(huqiang.Core.UIData.HImageData)o;
            ins.fillAmount = @fillAmount;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_fillCenter_4(ref object o)
        {
            return ((huqiang.Core.UIData.HImageData)o).fillCenter;
        }

        static StackObject* CopyToStack_fillCenter_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.UIData.HImageData)o).fillCenter;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method ? 1 : 0;
            return __ret + 1;
        }

        static void set_fillCenter_4(ref object o, object v)
        {
            huqiang.Core.UIData.HImageData ins =(huqiang.Core.UIData.HImageData)o;
            ins.fillCenter = (System.Boolean)v;
            o = ins;
        }

        static StackObject* AssignFromStack_fillCenter_4(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Boolean @fillCenter = ptr_of_this_method->Value == 1;
            huqiang.Core.UIData.HImageData ins =(huqiang.Core.UIData.HImageData)o;
            ins.fillCenter = @fillCenter;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_fillClockwise_5(ref object o)
        {
            return ((huqiang.Core.UIData.HImageData)o).fillClockwise;
        }

        static StackObject* CopyToStack_fillClockwise_5(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.UIData.HImageData)o).fillClockwise;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method ? 1 : 0;
            return __ret + 1;
        }

        static void set_fillClockwise_5(ref object o, object v)
        {
            huqiang.Core.UIData.HImageData ins =(huqiang.Core.UIData.HImageData)o;
            ins.fillClockwise = (System.Boolean)v;
            o = ins;
        }

        static StackObject* AssignFromStack_fillClockwise_5(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Boolean @fillClockwise = ptr_of_this_method->Value == 1;
            huqiang.Core.UIData.HImageData ins =(huqiang.Core.UIData.HImageData)o;
            ins.fillClockwise = @fillClockwise;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_fillMethod_6(ref object o)
        {
            return ((huqiang.Core.UIData.HImageData)o).fillMethod;
        }

        static StackObject* CopyToStack_fillMethod_6(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.UIData.HImageData)o).fillMethod;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_fillMethod_6(ref object o, object v)
        {
            huqiang.Core.UIData.HImageData ins =(huqiang.Core.UIData.HImageData)o;
            ins.fillMethod = (huqiang.Core.UIData.FillMethod)v;
            o = ins;
        }

        static StackObject* AssignFromStack_fillMethod_6(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.Core.UIData.FillMethod @fillMethod = (huqiang.Core.UIData.FillMethod)typeof(huqiang.Core.UIData.FillMethod).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)20);
            huqiang.Core.UIData.HImageData ins =(huqiang.Core.UIData.HImageData)o;
            ins.fillMethod = @fillMethod;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_fillOrigin_7(ref object o)
        {
            return ((huqiang.Core.UIData.HImageData)o).fillOrigin;
        }

        static StackObject* CopyToStack_fillOrigin_7(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.UIData.HImageData)o).fillOrigin;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_fillOrigin_7(ref object o, object v)
        {
            huqiang.Core.UIData.HImageData ins =(huqiang.Core.UIData.HImageData)o;
            ins.fillOrigin = (System.Int32)v;
            o = ins;
        }

        static StackObject* AssignFromStack_fillOrigin_7(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @fillOrigin = ptr_of_this_method->Value;
            huqiang.Core.UIData.HImageData ins =(huqiang.Core.UIData.HImageData)o;
            ins.fillOrigin = @fillOrigin;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_pixelsPerUnit_8(ref object o)
        {
            return ((huqiang.Core.UIData.HImageData)o).pixelsPerUnit;
        }

        static StackObject* CopyToStack_pixelsPerUnit_8(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.UIData.HImageData)o).pixelsPerUnit;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_pixelsPerUnit_8(ref object o, object v)
        {
            huqiang.Core.UIData.HImageData ins =(huqiang.Core.UIData.HImageData)o;
            ins.pixelsPerUnit = (System.Single)v;
            o = ins;
        }

        static StackObject* AssignFromStack_pixelsPerUnit_8(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @pixelsPerUnit = *(float*)&ptr_of_this_method->Value;
            huqiang.Core.UIData.HImageData ins =(huqiang.Core.UIData.HImageData)o;
            ins.pixelsPerUnit = @pixelsPerUnit;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_preserveAspect_9(ref object o)
        {
            return ((huqiang.Core.UIData.HImageData)o).preserveAspect;
        }

        static StackObject* CopyToStack_preserveAspect_9(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.UIData.HImageData)o).preserveAspect;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method ? 1 : 0;
            return __ret + 1;
        }

        static void set_preserveAspect_9(ref object o, object v)
        {
            huqiang.Core.UIData.HImageData ins =(huqiang.Core.UIData.HImageData)o;
            ins.preserveAspect = (System.Boolean)v;
            o = ins;
        }

        static StackObject* AssignFromStack_preserveAspect_9(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Boolean @preserveAspect = ptr_of_this_method->Value == 1;
            huqiang.Core.UIData.HImageData ins =(huqiang.Core.UIData.HImageData)o;
            ins.preserveAspect = @preserveAspect;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_Size_10(ref object o)
        {
            return huqiang.Core.UIData.HImageData.Size;
        }

        static StackObject* CopyToStack_Size_10(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.HImageData.Size;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_Size_10(ref object o, object v)
        {
            huqiang.Core.UIData.HImageData.Size = (System.Int32)v;
        }

        static StackObject* AssignFromStack_Size_10(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @Size = ptr_of_this_method->Value;
            huqiang.Core.UIData.HImageData.Size = @Size;
            return ptr_of_this_method;
        }

        static object get_ElementSize_11(ref object o)
        {
            return huqiang.Core.UIData.HImageData.ElementSize;
        }

        static StackObject* CopyToStack_ElementSize_11(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Core.UIData.HImageData.ElementSize;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_ElementSize_11(ref object o, object v)
        {
            huqiang.Core.UIData.HImageData.ElementSize = (System.Int32)v;
        }

        static StackObject* AssignFromStack_ElementSize_11(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @ElementSize = ptr_of_this_method->Value;
            huqiang.Core.UIData.HImageData.ElementSize = @ElementSize;
            return ptr_of_this_method;
        }


        static object PerformMemberwiseClone(ref object o)
        {
            var ins = new huqiang.Core.UIData.HImageData();
            ins = (huqiang.Core.UIData.HImageData)o;
            return ins;
        }


    }
}
